Skip to content

chore: dead code removal — 6,782 lines#147

Open
JustMaier wants to merge 9 commits intodesign/zero-downtime-deployfrom
chore/dead-code-removal
Open

chore: dead code removal — 6,782 lines#147
JustMaier wants to merge 9 commits intodesign/zero-downtime-deployfrom
chore/dead-code-removal

Conversation

@JustMaier
Copy link
Copy Markdown
Contributor

Summary

LSP-traced dead code removal across 7 tiers. Every deletion was verified via rust-analyzer references + grep to confirm zero live callers.

  • Tier 1: Delete entire dead files — slot_arena.rs (1,016), progress.rs (113), loader.rs (1,847), copy_queries.rs (364), rebuild_bench.rs (906). Remove NDJSON POST /load handler, V1 download path from bulk_loader.rs. Delete dead test/example files.
  • Tier 2: Dead engine methods — compact_docstore, persist_dirty_dictionaries, docstore_schema_version, indexed_field_names, layer_bases, layer_bases_fused, slot_matches_filters, distinct_count
  • Tier 3: V1 sync code — 11 row structs + 17 fetch functions from queries.rs, V1 helpers from bulk_loader.rs, dead ParsedRow methods
  • Tier 4: HashMap-based enrichment/expression paths superseded by indexed variants — EvalContext, Expr::eval(), DictionarySet, enrich_row(), etc.
  • Tier 5: Dead ops_processor code — document_to_ops, qvalue_to_json, OpsProcessorConfig
  • Tier 6: Gate MutationEngine, PatchPayload, PatchField, diff_document_partial, diff_patch behind #[cfg(test)] (test-only scaffolding)
  • Tier 7: Remove NOT_IMPLEMENTED stub endpoints (PATCH /documents/patch, POST /filter-sync)
  • Fix: Remove orphan parse_alloc_bench Cargo.toml entry (file was never committed)

Net: 22 files changed, 25 insertions, 6,782 deletions

Test plan

  • cargo build --features server,pg-sync — clean (warnings only)
  • cargo test --features server,pg-sync --lib — 598 passed, 0 failed
  • Each tier verified individually with build + test gate before committing

🤖 Generated with Claude Code

JustMaier and others added 9 commits April 4, 2026 20:52
…, rebuild_bench

Remove V1 NDJSON loader and supporting infrastructure (~4,200 lines):
- src/sync/slot_arena.rs (1016 lines) — V1 memory-mapped slot arena
- src/sync/progress.rs (113 lines) — V1 progress server
- src/sync/loader.rs (1847 lines) — V1 NDJSON loader
- src/sync/copy_queries.rs (364 lines) — V1 hardcoded COPY queries
- src/bin/rebuild_bench.rs (906 lines) — stale benchmark binary

Also removed:
- POST /load handler and LoadRequest struct from server.rs
- V1 download path (download_all_tables/download_table/download_single_table) from bulk_loader.rs
- ImageScalars, ResourceEnrichment, BulkLoadStats, finalize_from_bitmaps, scalars_to_json,
  cleanup_orphan_bitmaps and their tests from bulk_loader.rs
- AccumSink and its test from ingester.rs (depended on deleted BitmapAccum)
- V1 fallback in pg_sync.rs bin replaced with exit(1) + clear error

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- concurrent_engine: remove persist_dirty_dictionaries (no-op), compact_docstore,
  docstore_schema_version, indexed_field_names (all zero callers)
- sort: remove layer_bases, layer_bases_fused (zero callers);
  move slots_in_range behind #[cfg(test)]
- executor: remove with_string_maps, with_case_sensitive_fields, with_dictionaries,
  with_bitmap_silo, slot_matches_filters (all zero callers outside this file)
- filter: remove FilterField::distinct_count (zero callers)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
queries.rs: delete all V1 row structs (ImageRow, TagRow, ToolRow, TechniqueRow,
ResourceRow, OutboxRow, MetricRow, CollectionItemRow, StreamTagRow,
StreamResourceRow, StreamCollectionRow) and all dead fetch/range functions.
Keep: run_setup, run_setup_v2, get_max_ops_id, get_max_outbox_id,
upsert_cursor, SETUP_SQL, SETUP_V2_SQL, find_trigger_table, check_triggers_exist.

dump_processor.rs: delete ParsedRow::to_csv_row() — zero callers.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Deleted the HashMap-based eval() path from dump_expression.rs
(EvalContext, build_column_index, Expr::eval, FilterExpression::eval,
ComputedFieldDef::eval, ExprValue::as_str_value) and the corresponding
HashMap-based enrichment wrappers from dump_enrichment.rs
(LookupRow::get/to_csv_row/iter_columns, EnrichmentTable::get/child/
enrich/enrich_indexed, EnrichmentManager::enrich_row/enrich_row_indexed/
clear/drop_table/total_memory, resolve_dictionary_value,
resolve_expr_to_bitmap_key, DictionarySet). The indexed paths
(eval_indexed, enrich_indexed_into_with_buf, enrich_row_indexed_into)
are the only live production paths at 107M+ scale.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Deleted document_to_ops() (WAL refactor stub with zero external callers),
field_value_to_json() (only called by document_to_ops), qvalue_to_json()
(private helper for field_value_to_json), extract_multi_ints() (private
helper for document_to_ops), and OpsProcessorConfig struct (unused config
struct). Removed associated tests and cleaned up unused Duration/PathBuf
imports.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…nd #[cfg(test)]

These items have zero production callers — only used in test harnesses in
mutation.rs, executor.rs, and planner.rs tests. Gating them with
#[cfg(test)] removes them from release builds without deleting the tests
that rely on them.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Deleted handle_patch_documents, handle_filter_sync, FilterSyncRequest,
and FilterSyncEntry from server.rs — all returned 501 NOT_IMPLEMENTED
with no path to implementation. Removed their route registrations from
the router. Client code should use PUT upsert for all document writes.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
The [[bench]] entry referenced a file that was never committed.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant